class mat4x4
{
public:
float m[4][4];
inline void null(void)
{
memset(&m,0,sizeof(m));
}
inline void load_identity(void)
{
memset(m,0,sizeof(m));
m[0][0]=m[1][1]=m[2][2]=m[3][3]=1.0;
}
void set_rotation( float ang, vector& dir );
mat4x4 operator*(mat4x4& m1)
};
Member | Type | Description |
---|---|---|
m | float[][] | matrix elements |
null, load_identity, set_rotation, operators
This class implements a 4x4 matrix. The matrix can represent any linear transformation and is used for rotation, translation, scaling, etc...
mat4x4 m1,m2,m3;
m2.load_identity();
m3.load_identity();
m2.set_rotation(45,vector(0,0,1));
m3.set_rotation(30,vector(0,1,0));
m1=m2*m3;